home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.vic)
- {
- this._y = 491.2;
- }
- if(_root.loss)
- {
- this._y = 491.2;
- }
- if(!this.hitTest(_root.castle))
- {
- this._x += speed;
- }
- if(duped && _root.population < _root.poptot)
- {
- _root.population = _root.population + 1;
- _root.gold -= 1500;
- i++;
- duplicateMovieClip(_root.tro,"tr" + i,16384 + (20000 + i));
- _root["tr" + i]._x = -6.399999999999999;
- _root["tr" + i]._y = random(50) + 201.7;
- duped = false;
- }
- if(this.hitTest(_root.castle) && !attackin)
- {
- this.gotoAndPlay("attk");
- attackin = true;
- }
- if(this.dead && this._currentframe < 22)
- {
- this.gotoAndPlay("die");
- }
- f = 1;
- while(f < Math.round(_root.lvl / 2 + 1))
- {
- if(this.hit.hitTest(_root.castle["th" + f]))
- {
- this.gotoAndPlay("hurt");
- remaining--;
- attackin = false;
- _root.castle["th" + f].removeMovieClip();
- }
- f++;
- }
- if(this.dead)
- {
- this._x -= speed;
- }
- if(this.deadfull)
- {
- this._x = -1000000000;
- }
- l = 1;
- while(l < _root.lvl + 1)
- {
- if(this.hit.hitTest(_root["a" + l]))
- {
- this.gotoAndPlay("hurt");
- attackin = false;
- remaining--;
- _root["a" + l].removeMovieClip();
- }
- if(remaining == 0)
- {
- this.gotoAndPlay("die");
- remaining = 500;
- }
- l++;
- }
- }
-